<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    .clearfix::before,
    .clearfix::after {
      content: '';
      display: table;
      clear: both;
    }

    .box1{
      height: 200px;
      width: 200px;
      background-color: red;

      /*border :red solid 10px;*/
    }
    .box2{
      margin-top: 100px;
      width: 100px;
      height: 100px;
      background-color: #bfa;
      float: left;
    }
  </style>
</head>
<body>
<div class="box1 clearfix">
  <div class="box2"></div>
</div>
</body>
</html>